import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<PatrolPlanListViewState> buildReducer() {
  return asReducer(
    <Object, Reducer<PatrolPlanListViewState>>{
      PatrolPlanListViewAction.action: _onAction,
      PatrolPlanListViewAction.onTapIndex: _onTapIndex,
    },
  );
}

PatrolPlanListViewState _onAction(
    PatrolPlanListViewState state, Action action) {
  final PatrolPlanListViewState newState = state.clone();
  return newState;
}

PatrolPlanListViewState _onTapIndex(
    PatrolPlanListViewState state, Action action) {
  final PatrolPlanListViewState newState = state.clone()
    ..currentIndex = action.payload;
  return newState;
}
